<#assign path = request.contextPath/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" class="off">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <title>后台管理</title>
    <link href="${path}/statics/css/reset.css" rel="stylesheet" type="text/css"/>
    <link href="${path}/statics/css/zh-cn-system.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="${path}/statics/css/style/zh-cn-styles1.css" title="styles1" media="screen"/>
    <link rel="alternate stylesheet" type="text/css" href="${path}/statics/css/style/zh-cn-styles2.css" title="styles2"
          media="screen"/>
    <link rel="alternate stylesheet" type="text/css" href="${path}/statics/css/style/zh-cn-styles3.css" title="styles3"
          media="screen"/>
    <link rel="alternate stylesheet" type="text/css" href="${path}/statics/css/style/zh-cn-styles4.css" title="styles4"
          media="screen"/>
    <script src="${path}/statics/js/jquery-1.8.3.min.js" type="text/javascript" language="javascript"></script>
    <script src="${path}/statics/js/art/jquery.artDialog.js?skin=blue" type="text/javascript" language="javascript"></script>
    <script src="${path}/statics/js/art/iframeTools.js" type="text/javascript" language="javascript"></script>
    <script src="${path}/statics/js/admin_common.js" type="text/javascript" language="javascript"></script>
    <script language="javascript" type="text/javascript" src="${path}/statics/js/styleswitch.js"></script>
    <script language="javascript" type="text/javascript" src="${path}/statics/js/hotkeys.js"></script>
    <script language="javascript" type="text/javascript" src="${path}/statics/js/jquery.sgallery.js"></script>
    <style type="text/css">
        .objbody {
            overflow: hidden
        }

        .btns {
            background-color: #666;
        }

        .btns {
            position: absolute;
            top: 116px;
            right: 30px;
            z-index: 1000;
            opacity: 0.6;
        }

        .btns2 {
            background-color: rgba(0, 0, 0, 0.5);
            color: #fff;
            padding: 2px;
            border-radius: 3px;
            box-shadow: 0px 0px 2px #333;
            padding: 0px 6px;
            border: 1px solid #ddd;
        }

        .btns:hover {
            opacity: 1;
        }

        .btns h6 {
            padding: 4px;
            border-bottom: 1px solid #666;
            text-shadow: 0px 0px 2px #000;
        }

        .btns .pd4 {
            padding-top: 4px;
            border-top: 1px solid #999;
        }

        .pd4 li {
            border-radius: 0px 6px 0px 6px;
            margin-top: 2px;
            margin-bottom: 3px;
            padding: 2px 0px;
        }

        .btns .pd4 li span {
            padding: 0px 6px;
        }

        .pd {
            padding: 4px;
        }

        .ac {
            background-color: #333;
            color: #fff;
        }

        .hvs {
            background-color: #555;
            cursor: pointer;
        }

        .bg_btn {
            background: url(${path}/statics/images/admin_img/icon2.jpg) no-repeat;
            width: 32px;
            height: 32px;
        }
    </style>

    <script src="${path}/statics/js/art/jquery.artDialog.js?skin=blue" type="text/javascript" language="javascript"></script>
    <script src="${path}/statics/js/art/iframeTools.js" type="text/javascript" language="javascript"></script>
    <script type="text/javascript">
        $(function ()
        {

        });

    </script>
</head>
<body scroll="no" class="objbody">


<div class="header" style="width: auto;">
    <div class="logo lf">
        <a href="/admin">
            <span class="invisible"></span>
        </a>
    </div>
    <div class="col-auto">
        <div class="log white cut_line">

             您好！admin [超级管理员]<span>|</span>
            <a href="javascript:logout();">[退出]</a>

        </div>

        <ul id="top_menu" class="nav white">
            <li class="top_menu" id="_M0" style="display: block;">
                <a style="outline:none;" hidefocus="true"
                                                                     href="javascript:_M(0,'${path}/menu/ceshi')">测试</a>
            </li>
            <#--<li class="tab_web" style="margin-left: 10px"><a href="javascript:;" class=""><span>.</span></a></li>-->
            <#--<li class="tab_web" style="margin-left: 100px"><a href="javascript:;" class=""><span>.</span></a></li>-->


        </ul>
    </div>
</div>

<div id="content" style="width: auto;">
    <div class="col-left left_menu">
        <div id="Scroll" style="height: 165px;">
            <div id="leftMain">

            </div>
        </div>
        <a title="展开与关闭" class="open" hidefocus="hidefocus"
           style="outline-style: none; outline-width: medium; height: 215px;" id="openClose" href="javascript:;"><span
                class="hidden">展开</span></a>
    </div>

<#--这里是中间部分-->
<#--<div height="100%" style="display:none" id="display_center_id" class="col-1 lf cat-menu">-->
<#--<div class="content">-->
<#--<iframe width="100%" scrolling="auto" height="auto" frameborder="false" allowtransparency="true" style="border: medium none; height: 194px;" src="/indexmain" id="center_frame" name="center_frame"></iframe>-->
<#--</div>-->
<#--</div>-->
    <div class="col-auto mr8">
        <div class="crumbs">
            <div class="shortcut cu-span" style="display: none;">
                <a target="right" href="javascript:void(0);"><span>更新缓存</span></a><a href="javascript:void(0);"><span>后台地图</span></a>
            </div>
            当前位置： <span id="current_pos">我的面板 &gt; 个人信息 &gt; 修改个人信息 &gt;
                <span id="current_pos_attr"></span>
            </span>
        </div>
        <div class="col-1">
            <div class="content" style="position:relative; overflow:hidden">
                <iframe name="right" id="rightMain" src="${path}/default_right" frameborder="false" scrolling="auto"
                        style="border:none; margin-bottom:30px" width="100%" height="auto"
                        allowtransparency="true"></iframe>
                <div class="fav-nav">
                    <div id="panellist">
                    </div>
                    <div id="paneladd"></div>
                    <input type="hidden" id="menuid" value="">
                    <input type="hidden" id="bigid" value=""/>

                    <div id="help" class="fav-help"></div>
                </div>
            </div>
        </div>
    </div>
</div>



<div class="scroll">
    <a href="javascript:;" class="per" title="使用鼠标滚轴滚动侧栏" onclick="menuScroll(1);"></a>
    <a href="javascript:;" class="next" title="使用鼠标滚轴滚动侧栏" onclick="menuScroll(2);"></a>
</div>


<script type="text/javascript">

$(function ()
{

    <#--calljson("", "${path}/index_mgr/indexinfo", function (data)-->
    <#--{-->
        <#--$(".tab-web-panel:eq(0)").html(data["datas"]["hotel_list"]);-->
        <#--$(".tab-web-panel:eq(1)").html(data["datas"]["language_list"]);-->

        <#--$(".tab_web:eq(0)").html(data["datas"]["hotel_first"]);-->
        <#--$(".tab_web:eq(1)").html(data["datas"]["language_first"]);-->

        <#--$("#href_hotel_mgr").text(data["datas"]["href_hotel_mgr"]);-->
        <#--$("#href_sync_mgr").text(data["datas"]["href_sync_mgr"]);-->
    <#--});-->


    //下面是第一个下拉列表，酒店列表
    var tab_web = $(".tab_web:eq(0)");
    var offset = $(tab_web).offset();
    var tab_web_panel = $(".tab-web-panel:eq(0)");
    $(tab_web).mouseover(function ()
    {
        $('.tab-web-panel:eq(1)').hide();
        tab_web_panel.css({ "left": +$(this).offset().left + 4, "top": +offset.top + $(tab_web).height()});
        tab_web_panel.show();
        if (tab_web_panel.height() > 200)
        {
            tab_web_panel.children("ul").addClass("tab-scroll");
        }
    });
    $(tab_web).mouseout(function ()
    {
        $('.tab-web-panel').hide();
    });
    $(tab_web_panel).mouseover(function ()
    {
        $('.tab-web-panel:eq(0)').show();
        $('.tab-web-panel:eq(1)').hide();
        $(tab_web).find("a").addClass('on')
    }).mouseout(function ()
            {
                $('.tab-web-panel').hide();
                $(tab_web).find("a").removeClass('on')
            });

    // 下面是第二个下拉列表，语言
    var tab_web2 = $(".tab_web:eq(1)");
    var offset2 = $(tab_web2).offset();
    var tab_web_panel2 = $(".tab-web-panel:eq(1)");
    $(tab_web2).mouseover(function ()
    {
        $('.tab-web-panel:eq(0)').hide();
        tab_web_panel2.css({ "left": +$(this).offset().left + 4, "top": +offset2.top + $(tab_web2).height()});
        tab_web_panel2.show();
        if (tab_web_panel2.height() > 200)
        {
            tab_web_panel2.children("ul").addClass("tab-scroll");
        }
    });
    $(tab_web2).mouseout(function ()
    {
        $('.tab-web-panel').hide();
    });
    $(tab_web_panel2).mouseover(function ()
    {
        $('.tab-web-panel:eq(1)').show();
        $('.tab-web-panel:eq(0)').hide();
        $(tab_web2).find("a").addClass('on')
    }).mouseout(function ()
            {
                $('.tab-web-panel').hide();
                $(tab_web2).find("a").removeClass('on')
            });


    var addEvent = (function ()
            {
                if (window.addEventListener)
                {
                    return function (el, sType, fn, capture)
                    {
                        el.addEventListener(sType, fn, (capture));
                    };
                }
                else if (window.attachEvent)
                {
                    return function (el, sType, fn, capture)
                    {
                        el.attachEvent("on" + sType, fn);
                    };
                }
                else
                {
                    return function ()
                    {
                    };
                }
            })(),
            Scroll = document.getElementById('Scroll');
    // IE6/IE7/IE8/Opera 10+/Safari5+
    addEvent(Scroll, 'mousewheel', function (event)
    {
        event = window.event || event;
        if (event.wheelDelta <= 0 || event.detail > 0)
        {
            Scroll.scrollTop = Scroll.scrollTop + 29;
        }
        else
        {
            Scroll.scrollTop = Scroll.scrollTop - 29;
        }
    }, false);

    // Firefox 3.5+
    addEvent(Scroll, 'DOMMouseScroll', function (event)
    {
        event = window.event || event;
        if (event.wheelDelta <= 0 || event.detail > 0)
        {
            Scroll.scrollTop = Scroll.scrollTop + 29;
        }
        else
        {
            Scroll.scrollTop = Scroll.scrollTop - 29;
        }
    }, false);

    _M(0, "${path}/menu/ceshi");

});


if (!Array.prototype.map)
{
    Array.prototype.map = function (fn, scope)
    {
        var result = [], ri = 0;
        for (var i = 0, n = this.length; i < n; i++)
        {
            if (i in this)
            {
                result[ri++] = fn.call(scope, this[i], i, this);
            }
        }
        return result;
    };
}

var getWindowSize = function ()
{
    return ["Height", "Width"].map(function (name)
    {
        return window["inner" + name] ||
                document.compatMode === "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ]
    });
}

window.onload = function ()
{

    if (!+"\v1" && !document.querySelector)
    { // for IE6 IE7
        document.body.onresize = resize;
    }
    else
    {
        window.onresize = resize;
    }
    function resize()
    {
        wSize();
        return false;
    }
}

function wSize()
{
    //这是一字符串
    var str = getWindowSize();
    var strs = new Array(); //定义一数组
    strs = str.toString().split(","); //字符分割
    var heights = strs[0] - 150, Body = $('body');
    $('#rightMain').height(heights);
    //iframe.height = strs[0]-46;
    if (strs[1] < 980)
    {
        $('.header').css('width', 980 + 'px');
        $('#content').css('width', 980 + 'px');
        Body.attr('scroll', '');
        Body.removeClass('objbody');
    }
    else
    {
        $('.header').css('width', 'auto');
        $('#content').css('width', 'auto');
        Body.attr('scroll', 'no');
        Body.addClass('objbody');
    }

    var openClose = $("#rightMain").height() + 39;
    $('#center_frame').height(openClose + 9);
    $("#openClose").height(openClose + 30);
    $("#Scroll").height(openClose - 20);
    windowW();
}
wSize();
function windowW()
{
    if ($('#Scroll').height() < $("#leftMain").height())
    {
        $(".scroll").show();
    }
    else
    {
        $(".scroll").hide();
    }
}

//左侧开关
$("#openClose").click(function ()
{
    if ($(this).data('clicknum') == 1)
    {
        $("html").removeClass("on");
        $(".left_menu").removeClass("left_menu_on");
        $(this).removeClass("close");
        $(this).data('clicknum', 0);
        $(".scroll").show();
    }
    else
    {
        $(".left_menu").addClass("left_menu_on");
        $(this).addClass("close");
        $("html").addClass("on");
        $(this).data('clicknum', 1);
        $(".scroll").hide();
    }
    return false;
});

function _M(menuid, targetUrl)
{
//    alert(menuid + "====" + targetUrl);
//    var hotelid = $(".tab_web:eq(0)").find("a").attr("objid");
//    var languageid = $(".tab_web:eq(1)").find("a").attr("objid");
//    var args = "hotelid=" + hotelid + "&languageid=" + languageid + "";
//    $("#menuid").val(menuid);
//    $("#bigid").val(menuid);
//    $("#paneladd").html('<a class="panel-add" href="javascript:add_panel();"><em>添加</em></a>');

    $("#leftMain").load(targetUrl + "/?input=222", {limit: 25}, function ()
    {
        windowW();
    });

    $('.top_menu').removeClass("on");
    $('#_M' + menuid).addClass("on");

    //当点击顶部菜单后，隐藏中间的框架
    $('#display_center_id').css('display', 'none');
    //显示左侧菜单，当点击顶部时，展开左侧
    $(".left_menu").removeClass("left_menu_on");
    $("#openClose").removeClass("close");
    $("html").removeClass("on");
    $("#openClose").data('clicknum', 0);
    $("#current_pos").data('clicknum', 1);
}

//显示右侧的详细内容
function _MP(menuid, targetUrl)
{

    $("#menuid").val(menuid);
//    $("#paneladd").html('<a class="panel-add" href="javascript:add_panel();"><em>添加</em></a>');

//        $("#rightMain").attr('src', targetUrl + "/?etag=" + time() + "");
    $("#rightMain").attr('src', targetUrl);//不用非要使用etag
    $('.sub_menu').removeClass("on fb blue");
    $('#_MP' + menuid).addClass("on fb blue");

}




function menuScroll(num)
{
    var Scroll = document.getElementById('Scroll');
    if (num == 1)
    {
        Scroll.scrollTop = Scroll.scrollTop - 60;
    }
    else
    {
        Scroll.scrollTop = Scroll.scrollTop + 60;
    }
}

//锁屏
function lock_screen()
{
    $.get("${path}/admin/index/public_lock_screen");
    $('#dvLockScreen').css('display', '');
}

//解除锁屏
function check_screenlock()
{
    var lock_password = $('#lock_password').val();
    if (lock_password == '')
    {
        $('#lock_tips').html('<font color="red">密码不能为空。</font>');
        return false;
    }
    $.get("${path}/admin/index/public_login_screenlock", function (data)
    {
        if (data == 1)
        {
            $('#dvLockScreen').css('display', 'none');
            $('#lock_password').val('');
            $('#lock_tips').html('锁屏状态，请输入密码解锁');
        }
        else if (data == 3)
        {
            $('#lock_tips').html('<font color="red">密码重试次数太多</font>');
        }
        else
        {
            strings = data.split('|');
            $('#lock_tips').html('<font color="red">密码错误，您还有' + strings[1] + '次尝试机会！</font>');
        }
    });
}

function logout()
{
    $.get("${path}/login/logout", function (data)
    {
        redirect("${path}/");
    });

}

</script>
</body>
</html>


